package com.byzk.p2p.admin.base.vo;

import java.util.Date;

import com.byzk.p2p.admin.money.dto.BorrowPayment;
import com.byzk.p2p.admin.money.dto.BorrowPaymentDetail;

/**
 * 提供给还款方式算法的返回值
 * @author suker.zhou
 *
 */
public class PaymentRecordVo {
	
	private Integer id;//期数
	private Double total;
	private Double interest;
	private Double fund;
	private Double balance;
	private Double other; //累加还款值
	private Double amount=0.0; //还款总额
	private Date paymentDate;
	
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Double getTotal() {
		return total;
	}
	public void setTotal(Double total) {
		this.total = total;
	}
	public Double getInterest() {
		return interest;
	}
	public void setInterest(Double interest) {
		this.interest = interest;
	}
	public Double getFund() {
		return fund;
	}
	public void setFund(Double fund) {
		this.fund = fund;
	}
	public Double getBalance() {
		return balance;
	}
	public void setBalance(Double balance) {
		this.balance = balance;
	}
	public Date getPaymentDate() {
		return paymentDate;
	}
	public void setPaymentDate(Date paymentDate) {
		this.paymentDate = paymentDate;
	}
	public Double getOther() {
		return other;
	}
	public void setOther(Double other) {
		this.other = other;
	}
	public Double getAmount() {
		return amount;
	}
	public void setAmount(Double amount) {
		this.amount = amount;
	}
	
	public BorrowPayment convertItem(PaymentRecordVo vo){
		BorrowPayment detail=new BorrowPayment();
		detail.setPaymentTotal(vo.total);
		detail.setPaymentFund(vo.getFund());
		detail.setPaymentInterest(vo.getInterest());
		detail.setExpectDate(vo.getPaymentDate());
		detail.setPeriodIndex(vo.getId());
		return detail;
	}
	
	public BorrowPaymentDetail convertDetail(PaymentRecordVo vo){
		BorrowPaymentDetail detail=new BorrowPaymentDetail();
		detail.setPaymentTotal(0.0);
		detail.setPaymentFund(0.0);
		detail.setPaymentInterest(0.0);
		detail.setNotPaymentTotal(vo.total);
		detail.setNotPaymentFund(vo.getFund());
		detail.setNotPaymentInterest(vo.getInterest());
		detail.setExpectDate(vo.getPaymentDate());
		detail.setPeriodIndex(vo.getId());
		detail.setFee(0.00);
		return detail;
	}
}
